Class Path

java.lang.Object
edu.uky.ai.lp.ai.Path

public class Path
extends java.lang.Object
Utility methods for navigating paths though the Wumpus World.
Author:
Stephen G. Ware
  • Constructor Summary

    Constructors 
    Constructor Description
    Path()  
  • Method Summary

    Modifier and Type Method Description
    static java.lang.String getNewLocation​(java.lang.String current, Action action)
    Given the player's current location and a next move action to take, return the player's new location after the action is taken.
    static Action path​(java.lang.String from, java.lang.String to, java.util.Set<java.lang.String> visited)
    Given the player's current location and intended destination, return the next move action that needs to be taken to get to the destination.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Path

      public Path()
  • Method Details

    • path

      public static final Action path​(java.lang.String from, java.lang.String to, java.util.Set<java.lang.String> visited)
      Given the player's current location and intended destination, return the next move action that needs to be taken to get to the destination. Only visited squares will be considered.
      Parameters:
      from - the player's current location
      to - the player's destination
      visited - the set of visited squares
      Returns:
      the next move action to take to reach the destination
    • getNewLocation

      public static final java.lang.String getNewLocation​(java.lang.String current, Action action)
      Given the player's current location and a next move action to take, return the player's new location after the action is taken.
      Parameters:
      current - the player's current location
      action - the next move action to take
      Returns:
      the player's location after the action